package me.siphone.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.linphone.R;

public class CallTypeFragment extends BaseFragment {
    @Nullable
    @Override
    public View onCreateView(
            @NonNull LayoutInflater inflater,
            @Nullable ViewGroup container,
            @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_call_type, container, false);
        view.findViewById(R.id.btn_template_call)
                .setOnClickListener(
                        new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                getFragmentManager()
                                        .beginTransaction()
                                        .add(R.id.fl_call_container, new TemplateCallFragment())
                                        .addToBackStack(TextCallFragment.class.getSimpleName())
                                        .commit();
                            }
                        });
        view.findViewById(R.id.btn_text_call)
                .setOnClickListener(
                        new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                getFragmentManager()
                                        .beginTransaction()
                                        .add(R.id.fl_call_container, new TextCallFragment())
                                        .addToBackStack(TextCallFragment.class.getSimpleName())
                                        .commit();
                            }
                        });
        view.findViewById(R.id.btn_audio_call)
                .setOnClickListener(
                        new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                getFragmentManager()
                                        .beginTransaction()
                                        .add(R.id.fl_call_container, new AudioCallFragment())
                                        .addToBackStack(AudioCallFragment.class.getSimpleName())
                                        .commit();
                            }
                        });
        return view;
    }
}
